
function loadView(component) {
    return resolve => require([`views/${component}`], resolve);
}

function loadPage(component) {
    return resolve => require([`pages/${component}`], resolve);
}

const routes = [
    {
        path: '/login',
        name: 'login',
        component: loadPage('login/Login'),
        meta: {
            title: '登录'
        }
    },
    {
        path: '/home',
        name: 'home',
        component: loadView('Home'),
        meta: {
            title: '首页'
        }
    },
    {
        path: '*',
        redirect: {
            path: '/home'
        }
    }
];
export default routes;
